<template>
  <div  class="body-bg ">
    <el-container>
      <el-header class="topHeader">
        <div class="logo">
          <svg-icon iconClass="mountain-range" className="mountainRange" />
          <span>考研资料分享系统</span>
        </div>

        <div class="avatar">
          <el-dropdown trigger="click">
            <el-avatar
              src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
              style="width:35px;height:35px;"
            />
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item > <div style=" display: flex; flex-direction: row;" @click="personal"><svg-icon iconClass="personal" className="personal" /> 个人中心</div></el-dropdown-item>
              <el-dropdown-item  ><div style=" display: flex; flex-direction: row;" @click="exit"><svg-icon iconClass="exit" className="exit" /> 退出登录</div> </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </el-header>
    </el-container>
    <el-container>
      <el-header class="bannerHeader">
        <el-menu
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          mode="horizontal"
          menu-trigger="hover"
          router
        >
          <el-submenu index="1">
            <template slot="title">考研科目列表</template>
  
              <el-submenu index="1-1">
                <span slot="title">数学</span>
                <el-menu-item index="/home/dataShare?sname=数学一">数学一</el-menu-item>
                <el-menu-item index="/home/dataShare?sname=数学二">数学二</el-menu-item>
                <el-menu-item index="/home/dataShare?sname=数学三" >数学三</el-menu-item>
              </el-submenu>
              <el-submenu index="1-2">
                <span slot="title">英语</span>
                <el-menu-item index="1-2-1">英语一</el-menu-item>
                <el-menu-item index="1-2-2">英语二</el-menu-item>
              </el-submenu>
              <el-menu-item index="1-3">政治</el-menu-item>
              <el-submenu index="1-4">
                <span slot="title">专业课</span>
                <el-menu-item index="1-4-1">计算机408</el-menu-item>
                <el-menu-item index="1-4-2">法学</el-menu-item>
                <el-menu-item index="1-4-3">教育学</el-menu-item>
                <el-menu-item index="1-4-4">传媒</el-menu-item>
              </el-submenu>
    
          </el-submenu>
          <el-menu-item index="5">院校资讯</el-menu-item>
          <el-menu-item index="/home/oneWord">每日一句</el-menu-item>
        </el-menu>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
       <el-footer>
          	2021 &copy; guqingyao.
       </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: true,
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    exit(){
          this.$router.push({
        name: "Login",
      });
  
    },
        personal(){
               this.$router.push({
        name: "Information",
      });
        }
  },
};
</script>

<style scoped>
.el-footer{
  background-color: #fff;
  color: black;
  padding-left:60px ;
  line-height: 60px;
  border-top:solid 1px rgb(221, 221, 221);
 
}
.avatar {
  margin-right: 80px;
  margin-top: 10px;
}
.topHeader {
  background-color: rgb(47, 53, 63);
  color: rgb(255, 255, 255);
  line-height: 60px;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}
.bannerHeader {
  line-height: 65px;
  background-color: rgb(255, 255, 255);
}
.el-avatar {
  cursor: pointer;
}

.el-menu--collapse {
  width: 110px;
}
.el-menu-vertical-demo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.mountainRange {
  transform: translateY(4px);
  font-size: 20px;
}

.logo span {
  padding-left: 10px;
}
.logo {
  margin-left: 60px;
}
.body-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow-y: auto;
  background: #f5f5f5 !important;
}
svg{
  font-size: 20px;
  margin-right: 5px;
  margin-top: 8px;
}
</style>
